#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <math.h>
void Judge(int n, int sq)
{
	int tmp = n, size = 1;
	while (tmp /= 10)
		size++;
	int right = 0;
	for (int i = 0; i < size; i++)
	{
		int c = pow(10, i);
		right += (sq % 10)*c;
		sq /= 10;
	}
	if (right == n)
		printf("Yes\n");
	else
		printf("No\n");
}
int main()
{
	int n;
	int k = 1;
	while (scanf("%d", &n) == 1)
	{
		int sq = n * n;
		printf("Case %d: %d, %d, ", k++,n,sq);
		
		Judge(n, sq);
	}
	return 0;
}